clc;close all;clear all;
RC=1e-6;
a=[RC 1];
b=[1];

T=RC/1.8/10;
fd=1/T;
f=0:100:fd/2;
Hs=freqs(b,a,2*pi*f);
figure(2);
az = [1+2*RC/T, 1-2*RC/T]; bz = [1, 1];
[Hz,fnorm] = (freqz(bz, az));


plot(2*pi*f, abs(Hs));
hold on
figure(3);

plot(2*fnorm*(fd/2),abs(Hz),'r')
n=1000
t=(0:n-1)/fd;
figure(3);
e=randn(1,n);
u=filter(bz,az,e);
plot(t,u);
us=abs(fft(u));
us=us(1:n/2);
plot((0:n/2-1)/(n/2)*(fd/2),us)


